package com.itheima.mall.service.pmsService;


import com.itheima.mall.commons.R;
import com.itheima.pojo.pms.PmsBrand;
import com.itheima.pojo.pms.PmsProductAttributeCategory;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class PmsBrandService {

    @DubboReference
    private PmsBrandApi brandApi;

//    @Autowired
//    private OssTemplate ossTemplate;

    //添加品牌
    public void addBrand(PmsBrand brand) {
        brandApi.addBrand(brand);
    }

    //删除品牌
    public void delete(Integer id) {
        brandApi.delete(id);
    }

    //根据品牌名称查询分类列表


    //获取全部品牌列表
    public List<PmsBrand> listAll() {
        return brandApi.listAll();
    }

    //批量删除
    public void deleteIds(List<Integer> ids) {
        brandApi.deleteIds(ids);
    }

    //批量更新厂商状态
    public void updateStatus(Integer factoryStatus, List<Long> ids) {
        brandApi.updateStatus(factoryStatus,ids);
    }

    //批量更新是否显示
    public void updateShowstatus(Integer showStatus, List<Long> ids) {
        brandApi.updateShowstatus(showStatus,ids);
    }

    //更新品牌
    public void updateBrand(PmsBrand brand) {
        brandApi.updateBrand(brand);
    }


    public PmsBrand findById(Long id) {
        return brandApi.findById(id);
    }

    //根据品牌名称查询分类列表
    public R findBrand(String keyword, Integer pageNum, Integer pageSiZe) {
        return brandApi.findBrand(pageNum,pageSiZe,keyword);
    }
}





